<?php
//Teste
include './Config/Routes.php';
include './Action/CommonAction.php';
include './Config/Action.php';
include './vendor/autoload.php';
include './Config/bootstrap.php';

$smarty = new Smarty();
$smarty->setTemplateDir("./View/templates/");
$smarty->setCompileDir("./View/templates_c/");

$routes = new Routes();
$home = false;

if($routes->redirect()){
    $classAction = $routes->getAction();
    $method = $routes->getMethod();
    $class = new $classAction($smarty);
    $class->$method();
    
    if(!$class->getMethodExists()){
        $home = true;
    }
}else{
    $home = true;
}

$branch = "/imoveis/branches/tag_01/";

if($home){
    //header('Location: http://' . CommonAction::getServerName() . $branch . "home");
    header('Location: http://' . CommonAction::getServerName() . $branch . "index.php?c=main&m=home");
}
